Conversation
|
Skipping CI for Draft Pull Request. |
Implements ContainerResourceCaps configuration to enforce maximum resource limits and requests for workspace containers. When configured, container resource requirements that exceed the caps will be limited to the maximum values. This feature does not apply to initContainers or projectClone containers. Changes include: - New ContainerResourceCaps field in DevWorkspaceOperatorConfig API - Updated CRDs with the new field definition - Controller integration to pass resource caps to container handlers - Resource capping logic in container, flatten, merge, and projects packages - Tests for resource cap enforcement Assisted-by: Claude. Signed-off-by: Anatolii Bazko <abazko@redhat.com>
|
@tolusha thank you for the PR, I noticed that if I set for example: And create a devworkspace with no cpu limits or requests: DevworkspaceThen it looks like the If I update the DWOC to set the cpu limit and request cap to I think the cap should not be applied to the cpu in both cases? |
|
@dkwon17 |
|
@tolusha : I have a minor question about the precedence order of these fields. I see there is an older field I was under the impression that Could you please review if these expectations are correct?
|
|
Hello, @rohanKanojia |
| // No CPU limit or request is added by default. | ||
| DefaultContainerResources *corev1.ResourceRequirements `json:"defaultContainerResources,omitempty"` | ||
| // ContainerResourceCaps defines the maximum resource requirements enforced for all | ||
| // workspace containers. If a container specifies higher limits or requests, they |
There was a problem hiding this comment.
There was a problem hiding this comment.
Semantically when I hear ContainerResourceCaps, to me it sounds like only an upper limit, and not a default if limits / requests are not defined in the devfile.
If we want defaults applied when limits/requests are not defined in the devfile, IMHO the DefaultContainerResources should be the field for that
There was a problem hiding this comment.
if a container does not specify limits / requests the maximums from DWOC will be used,
I would rather not have this functionality, since right now, DefaultContainerResources will be used instead which IMHO makes more sense
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dkwon17, rohanKanojia, tolusha The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
1 similar comment
|
/retest |
What does this PR do?
Implements ContainerResourceCaps configuration to enforce maximum resource limits and requests for workspace containers. When configured, container resource requirements that exceed the caps will be limited to the maximum values. This feature does not apply to initContainers or projectClone containers.
Assisted-by: Claude.
What issues does this PR fix or reference?
https://issues.redhat.com/browse/CRW-9546
Is it tested? How?
Start a workspace from devifile
Check containers resources in a workspace deployment:
PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-pathto trigger)v8-devworkspace-operator-e2e: DevWorkspace e2e testv8-che-happy-path: Happy path for verification integration with Che